﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" MaintainScrollPositionOnPostback="true" CodeBehind="EspaciosViewModify.aspx.cs" Inherits="Recursos.WebForm2" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <h2>Modificar Espacio</h2>
    <asp:GridView ID="GridView1" runat="server" CellPadding="3" GridLines="Horizontal"
   Font-Names="Verdana" Font-Size="10" DataKeyNames="id" OnRowDataBound="gridView_RowDataBound"
   AutoGenerateColumns="false" onrowcancelingedit="GridView1_RowCancelingEdit" 
        onrowediting="GridView1_RowEditing"  onrowupdating="GridView1_RowUpdating" 

        Width="1150px" onrowdeleting="GridView1_RowDeleting">


   
   <HeaderStyle BackColor="#336699" ForeColor="White" HorizontalAlign="Left" Height="25" />            
            
   <Columns>
      <asp:CommandField ButtonType="Button" ShowEditButton="true" ShowCancelButton="true"  EditText="Editar" CancelText="Cancelar" UpdateText="Actualizar" />
                 
      <asp:TemplateField>
        <ItemTemplate>
            <asp:Button ID="deleteButton" runat="server" CommandName="Delete" Text="Eliminar"
            OnClientClick="return confirm('Está seguro de que desea eliminar el espacio?');" />
        </ItemTemplate>
      </asp:TemplateField>     
                   
      <asp:BoundField DataField="id" HeaderText="" ReadOnly="true" Visible="False" />

      <asp:TemplateField HeaderText="Codigo">
          <ItemTemplate>
              <%# Eval("Codigo")%>
          </ItemTemplate>
          <EditItemTemplate>
              <asp:TextBox runat="server" ID="Codigo" Text='<%# Eval("Codigo")%>' TextMode="MultiLine" Width="50px"/>
          </EditItemTemplate>
      </asp:TemplateField>                     
      
      <asp:TemplateField HeaderText="Tipo">
          <ItemTemplate>
            <%# Eval("TipoEspacio.Nombre")%>
          </ItemTemplate>
          <EditItemTemplate>
            <asp:DropDownList ID="DropdownTipo" runat="server" DataValueField="id"  DataTextField="Nombre" />
          </EditItemTemplate>
      </asp:TemplateField>         

      <asp:TemplateField HeaderText="Sede">
          <ItemTemplate>
              <%# Eval("Sede.Nombre")%>
          </ItemTemplate>
          <EditItemTemplate>
              <asp:DropDownList ID="DropdownSede" runat="server" DataValueField="id"  DataTextField="Nombre" />
          </EditItemTemplate>
      </asp:TemplateField>
      
      <asp:TemplateField HeaderText="Carrera">
          <ItemTemplate>
              <%# Eval("Carrera.Nombre")%>
          </ItemTemplate>
          <EditItemTemplate>
              <asp:DropDownList ID="DropdownCarrera" runat="server" DataValueField="id"  DataTextField="Nombre" />
          </EditItemTemplate>
      </asp:TemplateField>

      <asp:TemplateField HeaderText="Descripcion">
          <ItemTemplate>
              <%# Eval("Descripcion")%>
          </ItemTemplate>
          <EditItemTemplate>
              <asp:TextBox runat="server" ID="Descripcion" Text='<%# Eval("Descripcion")%>' TextMode="MultiLine" />
          </EditItemTemplate>
      </asp:TemplateField>      
 
      <asp:TemplateField HeaderText="Capacidad" >
          <ItemTemplate>
              <%# Eval("Capacidad")%>
          </ItemTemplate>
          <EditItemTemplate>
              <asp:TextBox runat="server" ID="Capacidad" Text='<%# Eval("Capacidad")%>' Width="30px"  />
               <asp:CompareValidator ID="cv2" runat="server" ControlToValidate="Capacidad" Type="Integer" ForeColor="red"
   Operator="DataTypeCheck" ErrorMessage="Error" />

             </EditItemTemplate>
      </asp:TemplateField>  
   
      <asp:TemplateField HeaderText="Estado">
          <ItemTemplate>
              <%# Eval("Estado")%>
          </ItemTemplate>
          <EditItemTemplate>
              <asp:DropDownList ID="DropdownEstado" runat="server"  />
              
          </EditItemTemplate>
         
      </asp:TemplateField>  

    </Columns>
            
</asp:GridView>

</asp:Content>
